# Contributor: Russ Webber <russ@rw.id.au>
# Maintainer: Russ Webber <russ@rw.id.au>
pkgname=py3-pydocstyle
pkgver=6.3.0
pkgrel=1
pkgdesc="Static analysis tool for checking compliance with Python docstring conventions"
url="https://www.pydocstyle.org/"
arch="noarch"
license="MIT"
depends="python3 py3-snowballstemmer"
makedepends="
	py3-gpep517
	py3-poetry-core
	py3-setuptools_scm
	"
checkdepends="py3-pytest py3-mock"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/PyCQA/pydocstyle/archive/$pkgver.tar.gz"
builddir="$srcdir/pydocstyle-$pkgver"

prepare() {
	default_prepare

	sed -i "s|0.0.0-dev|$pkgver|" pyproject.toml
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest --deselect src/tests/test_integration.py 
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f8473b19ab6ef0b61787875558f9dd6f9f7f1954e1baa0010942af6d4de8dbca30c8c08be6acbf24aadd1c0a601ba9467b747026a6cd22379f0c4b84a38b57c7  py3-pydocstyle-6.3.0.tar.gz
"
